<?php $this->headScript()->appendFile($this->JS_PATH . 'form_client.js'); ?>
<link rel="stylesheet" href="<?php echo $this->CSS_PATH ?>main.css">
<div id="client-listing"></div>
<div class="content">
    <div class="page-title"> <i class="icon-custom-right"></i>
        <h3><span class="semi-bold"><?php echo $this->mode;?> Client</span></h3>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="grid simple">
                <div class="grid-title">
                </div>
                <div class="grid-body ">
                    <div class="row">
						<?php if (count($this->errorMessageArray) > 0): ?>
                            <div class="alert alert-error">
                                <?php foreach ($this->errorMessageArray as $erroValue): ?>
                                    <div class="text-left">
                                        <i class="icon-remove-sign"></i>
                                        <?php echo $erroValue; ?>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        <?php endif; ?>

                   
                <form role="form"  id="client-form" name="client-form"  enctype="multipart/form-data"  action="" method="post">
                   
                    <div class="row form-row">
                        <div class="col-md-3">
                            <label class="form-label">First Name
								<span class="span_required">*</span>
							</label>
                            <?php echo $this->form->clnt_first_name; ?>
						</div>
                    
						<div class="col-md-3">
							<label class="form-label">Middle Name</label>
							<?php echo $this->form->clnt_middle_name; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">Last Name
								<span class="span_required">*</span>
							</label>
							<?php echo $this->form->clnt_last_name; ?>
						</div>
                    </div> 
                    
                    <div class="row form-row">
						<div class="col-md-3">
							<label class="form-label">Email
								<span class="span_required">*</span>
							</label>
							<?php echo $this->form->clnt_email; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">Phone No.
								<span class="span_required">*</span>
							</label>
							<?php echo $this->form->clnt_phone; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">Date of Birth
								<span class="span_required">*</span>
							</label>
							<div class="input-append success date ">
								<?php echo $this->form->clnt_dob; ?>
								<span class="add-on"><span class="arrow"></span><i class="fa fa-th"></i></span>
							</div>
						</div>
					</div>			

					<div class="row form-row">
                        <div class="col-md-3">
                            <label class="form-label">Site</label>
                            <?php echo $this->form->clnt_site ; ?>
                        </div>
                    
						<div class="col-md-3">
							<label class="form-label">Company</label>
							<?php echo $this->form->clnt_company ; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">&nbsp;</label>
							<button id="add_company" class="btn btn-success" data-toggle="modal"> Add Company </button>
						</div>
                    </div> 
                    
                    <div class="row form-row">
						<div class="col-md-4">
							<label class="form-label">Description</label>
							<?php echo $this->form->clnt_description; ?>
						</div>
                    
                        <div class="col-md-4">
                            <label class="form-label">Comment</label>
                            <?php echo $this->form->clnt_comment; ?>
                        </div>
                    </div> 

                    <div class="row form-row">
						<div class="col-md-3">
							<label class="form-label">Adress1</label>
							<?php echo $this->form->clnt_adrline1; ?>
						</div>
                    
						<div class="col-md-3">
							<label class="form-label">Adress2</label>
							<?php echo $this->form->clnt_adrline2; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">Adress3</label>
							<?php echo $this->form->clnt_adrline3; ?>
						</div>
                    </div>
					
					<div class="row form-row">
						<div class="col-md-3">
							<label class="form-label">Street</label>
							<?php echo $this->form->clnt_street; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">Postal</label>
							<?php echo $this->form->clnt_postal; ?>
						</div>
                    
						<div class="col-md-3">
							<label class="form-label">City</label>
							<?php echo $this->form->clnt_city; ?>
						</div>
                    </div>
					
					<div class="row form-row">
						<div class="col-md-3">
							<label class="form-label">Country</label>
							<?php echo $this->form->clnt_country; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">Position</label>
							<?php echo $this->form->clnt_position; ?>
						</div>
					
						<br/>
						<div class="col-md-3">
							<?php 
								$checked = "";
								if ($this->clnt_available_to_everyone == 1) {
								  $checked = "checked";
								} 
							?>
							<label>
								<input type="checkbox" name="clnt_available_to_everyone" <?php echo $checked;?> value="1">&nbsp; Client available to everyone
							</label>
						</div>
					</div>

                    <div class="row form-row">
						<div class="col-md-3">
							<label class="form-label">Client Type</label>
							<?php echo $this->form->clnt_type; ?>
						</div>
                    
						<div class="col-md-3">
							<label class="form-label">Source</label>
							<?php echo $this->form->clnt_source; ?>
						</div>
						
						<div class="col-md-3">
							<label class="form-label">Status
								<span class="span_required">*</span>
							</label>
							<?php echo $this->form->clnt_status; ?>
						</div>
                    </div>
					
					
						
                    
				   <div class="col-md-6">
					<?php if ($this->mode == 'Edit'): ?>
						<input type="submit" value="Update" class="submitfrmbtn btn btn-primary" name="Update"/>
					<?php else: ?>
						<input type="submit" value="Submit" class="submitfrmbtn   btn btn-primary" name="Submit"/>
					<?php endif; ?>
						<a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'client', 'action' => 'form'), null, TRUE); ?>" class="btn btn-default"/>
							Cancel
						</a>
				</div>
                </form>
              </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- END PAGE -->  


<!-- Assign to client modal -->
<div class="modal fade" id="myModal_company" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 id="myModalLabel" class="semi-bold">Add Company</h4>
            </div>
            <div class="modal-body">
                <div class="row form-row">
                    <div class="alert alert-error" id="error_add_client" style="display: none">
                        Please select client.
                    </div>
                    <div class="alert alert-success" id="success_add_client" style="display: none">
                        Client add successfully.
                    </div>
				
					<div class="col-md-10">
						<div class="col-md-2">Name </div>
						<div class="col-md-8">
							<input type="text" name="comp_name" id="comp_name" style="width: 300px;"/>
						</div>
					</div>
				
					<div class="col-md-10">
						<div class="col-md-2">Type </div> 
						<div class="col-md-8">
							<select style="width: 300px;" class=" " name="comp_type" id="comp_type">
								<?php foreach ($this->companytypeArray as $key => $value): ?>
									<option value="<?php echo $key; ?>"><?php echo $value; ?></option>
								<?php endforeach; ?>
							</select>
						</div>
					</div>
					
					<div class="col-md-10">
						<div class="col-md-2">Industry </div>
						<div class="col-md-8">
							<select style="width: 300px;" class=" " name="comp_industry" id="comp_industry">
								<?php foreach ($this->companyindustryArray as $key => $value): ?>
									<option value="<?php echo $key; ?>"><?php echo $value; ?></option>
								<?php endforeach; ?>
							</select>
						</div>
					</div>
					
					<div class="col-md-10">
						<div class="col-md-2">Email </div> 
						<div class="col-md-8">
							<input type="text" name="comp_email" id="comp_email" style="width: 300px;"/>
						</div>
					</div>
					
					<div class="col-md-10">
						<div class="col-md-2">Phone </div> 
						<div class="col-md-8">
							<input type="text" name="comp_phone" id="comp_phone" style="width: 300px;"/>
						</div>
					</div>
				
					<div class="col-md-10">
						<div class="col-md-2">Address </div> 
						<div class="col-md-8">
							<textarea rows="3" cols="43" name="comp_adrline1" id="comp_adrline1"></textarea>
						</div>
					</div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="add_btn_company">Save changes</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->